package com.example.administrator.myapplication.app;

import android.app.Application;
import android.util.Log;

import com.example.administrator.myapplication.dagger.app.AppComponent;
import com.example.administrator.myapplication.dagger.app.AppModule;
import com.example.administrator.myapplication.dagger.app.DaggerAppComponent;
import com.tencent.smtt.sdk.QbSdk;

/**
 * @author chenliangzhi
 * @date 2018/3/21
 * @describe
 */

public class MyApp extends Application {
    private AppComponent mAppComponent;

    @Override
    public void onCreate() {
        super.onCreate();
        DaggerAppComponent.builder().appModule(new AppModule(this)).build();
        //搜集本地tbs内核信息并上传至服务器，服务器返回决定使用哪个内核
        QbSdk.PreInitCallback cb = new QbSdk.PreInitCallback() {
            @Override
            public void onCoreInitFinished() {

            }

            @Override
            public void onViewInitFinished(boolean b) {
                Log.d("app", " onViewInitFinished is ");
            }
        };
        QbSdk.initX5Environment(getApplicationContext(), cb);

    }

    public AppComponent getAppComponent() {
        return this.mAppComponent;
    }
}
